<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Spring Boot 简介 | 月月博客</title><meta name="author" content="月月"><meta name="copyright" content="月月"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Spring Boot：简化 Spring 开发的神器Spring Boot 简介什么是 Spring Boot？ Spring Boot 是基于 Spring Framework 的一个开源 Java 基于 Spring 框架的快速开发框架，由 Pivotal 团队开发。它旨在简化 Spring 应用的初始搭建以及开发过程。Spring Boot 的核心目标是让开发者能够快速上手，减少配置，快速">
<meta property="og:type" content="article">
<meta property="og:title" content="Spring Boot 简介">
<meta property="og:url" content="https://blog.tuxiw.cn/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringBoot.html">
<meta property="og:site_name" content="月月博客">
<meta property="og:description" content="Spring Boot：简化 Spring 开发的神器Spring Boot 简介什么是 Spring Boot？ Spring Boot 是基于 Spring Framework 的一个开源 Java 基于 Spring 框架的快速开发框架，由 Pivotal 团队开发。它旨在简化 Spring 应用的初始搭建以及开发过程。Spring Boot 的核心目标是让开发者能够快速上手，减少配置，快速">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://api.r10086.com/%E6%A8%B1%E9%81%93%E9%9A%8F%E6%9C%BA%E5%9B%BE%E7%89%87api%E6%8E%A5%E5%8F%A3.php?%E5%9B%BE%E7%89%87%E7%B3%BB%E5%88%97=%E5%8A%A8%E6%BC%AB%E7%BB%BC%E5%90%886">
<meta property="article:published_time" content="2025-05-08T01:31:22.000Z">
<meta property="article:modified_time" content="2025-05-08T02:16:12.579Z">
<meta property="article:author" content="月月">
<meta property="article:tag" content="Spring">
<meta property="article:tag" content="Java">
<meta property="article:tag" content="SpringBoot">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://api.r10086.com/%E6%A8%B1%E9%81%93%E9%9A%8F%E6%9C%BA%E5%9B%BE%E7%89%87api%E6%8E%A5%E5%8F%A3.php?%E5%9B%BE%E7%89%87%E7%B3%BB%E5%88%97=%E5%8A%A8%E6%BC%AB%E7%BB%BC%E5%90%886"><script type="application/ld+json">{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  "headline": "Spring Boot 简介",
  "url": "https://blog.tuxiw.cn/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringBoot.html",
  "image": "https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合6",
  "datePublished": "2025-05-08T01:31:22.000Z",
  "dateModified": "2025-05-08T02:16:12.579Z",
  "author": [
    {
      "@type": "Person",
      "name": "月月",
      "url": "https://blog.tuxiw.cn/"
    }
  ]
}</script><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://blog.tuxiw.cn/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringBoot.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>
    (() => {
      
    const saveToLocal = {
      set: (key, value, ttl) => {
        if (!ttl) return
        const expiry = Date.now() + ttl * 86400000
        localStorage.setItem(key, JSON.stringify({ value, expiry }))
      },
      get: key => {
        const itemStr = localStorage.getItem(key)
        if (!itemStr) return undefined
        const { value, expiry } = JSON.parse(itemStr)
        if (Date.now() > expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return value
      }
    }

    window.btf = {
      saveToLocal,
      getScript: (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        Object.entries(attr).forEach(([key, val]) => script.setAttribute(key, val))
        script.onload = script.onreadystatechange = () => {
          if (!script.readyState || /loaded|complete/.test(script.readyState)) resolve()
        }
        script.onerror = reject
        document.head.appendChild(script)
      }),
      getCSS: (url, id) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onload = link.onreadystatechange = () => {
          if (!link.readyState || /loaded|complete/.test(link.readyState)) resolve()
        }
        link.onerror = reject
        document.head.appendChild(link)
      }),
      addGlobalFn: (key, fn, name = false, parent = window) => {
        if (!false && key.startsWith('pjax')) return
        const globalFn = parent.globalFn || {}
        globalFn[key] = globalFn[key] || {}
        globalFn[key][name || Object.keys(globalFn[key]).length] = fn
        parent.globalFn = globalFn
      }
    }
  
      
      const activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      const activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }

      btf.activateDarkMode = activateDarkMode
      btf.activateLightMode = activateLightMode

      const theme = saveToLocal.get('theme')
    
          theme === 'dark' ? activateDarkMode() : theme === 'light' ? activateLightMode() : null
        
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        document.documentElement.classList.toggle('hide-aside', asideStatus === 'hide')
      }
    
      
    const detectApple = () => {
      if (/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)) {
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
  
    })()
  </script><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false,"highlightFullpage":false,"highlightMacStyle":false},
  copy: {
    success: '复制成功',
    error: '复制失败',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'null',
  Snackbar: {"chs_to_cht":"已切换为繁体中文","cht_to_chs":"已切换为简体中文","day_to_night":"已切换为深色模式","night_to_day":"已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"top-right"},
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyloadPlugin: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Spring Boot 简介',
  isHighlightShrink: false,
  isToc: true,
  pageType: 'post'
}</script><link rel="stylesheet" href="/css/floatbox.css"><link rel="stylesheet" href="/css/footer.css"><link rel="stylesheet" href="/css/transpancy.css"><link rel="stylesheet" href="/css/custom.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zhheo/JS-Heo@main/rightmenu/rightmenu.css"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/zhheo/JS-Heo@main/mainColor/heoMainColor.css"><script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_1.css" ><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/zyoushuo/Blog@latest/hexo/css/loading_style_2.css" ><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiperstyle.css" media="print" onload="this.media='all'"><!-- hexo injector head_end end --><meta name="generator" content="Hexo 7.3.0"><link rel="alternate" href="/atom.xml" title="月月博客" type="application/atom+xml">
</head><body><div class="float-box left top"></div><div class="float-box left bottom"></div><div class="float-box right top"></div><div class="float-box right bottom"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img text-center"><img src="/img/loading.gif" data-original="/img/tx/tx1.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data text-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">10</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-book"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-paper-plane"></i><span> 导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://nav.tuxiw.cn/"><i class="fa-fw fas fa-sign-in"></i><span> 站内</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://nav.shiguang666.eu.org/"><i class="fa-fw fas fa-sign-out"></i><span> 站外</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-flask"></i><span> 实验室</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/news"><i class="fa-fw fa fa-calendar"></i><span> 每日早报</span></a></li><li><a class="site-page child" href="/random"><i class="fa-fw fas fa-random"></i><span> 随机文章</span></a></li><li><a class="site-page child" href="/atom.xml"><i class="fa-fw fas fa-rss"></i><span> RSS订阅</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-user-group"></i><span> 友链</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/flink/"><i class="fa-fw fa-solid fa-user-tie"></i><span> 本站友链</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.travellings.cn/go.html"><i class="fa-fw fa fa-subway"></i><span> 随机开往</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://travel.moe/go.html?travel=on"><i class="fa-fw fa fa-taxi"></i><span> 异次元之旅</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/comment/"><i class="fa-fw fas fa-comments"></i><span> 留言</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url(https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合6);"><nav id="nav"><span id="blog-info"><a class="nav-site-title" href="/"><img class="site-icon" src="/img/loading.gif" data-original="/img/tx/tx1.jpg" alt="Logo"><span class="site-name">月月博客</span></a><a class="nav-page-title" href="/"><span class="site-name">Spring Boot 简介</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-book"></i><span> 文章</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fas fa-paper-plane"></i><span> 导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://nav.tuxiw.cn/"><i class="fa-fw fas fa-sign-in"></i><span> 站内</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://nav.shiguang666.eu.org/"><i class="fa-fw fas fa-sign-out"></i><span> 站外</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-flask"></i><span> 实验室</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/news"><i class="fa-fw fa fa-calendar"></i><span> 每日早报</span></a></li><li><a class="site-page child" href="/random"><i class="fa-fw fas fa-random"></i><span> 随机文章</span></a></li><li><a class="site-page child" href="/atom.xml"><i class="fa-fw fas fa-rss"></i><span> RSS订阅</span></a></li></ul></div><div class="menus_item"><span class="site-page group"><i class="fa-fw fa-solid fa-user-group"></i><span> 友链</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/flink/"><i class="fa-fw fa-solid fa-user-tie"></i><span> 本站友链</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.travellings.cn/go.html"><i class="fa-fw fa fa-subway"></i><span> 随机开往</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://travel.moe/go.html?travel=on"><i class="fa-fw fa fa-taxi"></i><span> 异次元之旅</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/comment/"><i class="fa-fw fas fa-comments"></i><span> 留言</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><span class="site-page"><i class="fas fa-bars fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">Spring Boot 简介</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2025-05-08T01:31:22.000Z" title="发表于 2025-05-08 09:31:22">2025-05-08</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2025-05-08T02:16:12.579Z" title="更新于 2025-05-08 10:16:12">2025-05-08</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">学习笔记</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span id="" data-flag-title=""><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">浏览量:</span><span id="twikoo_visitors"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="container post-content" id="article-container"><h1 id="Spring-Boot：简化-Spring-开发的神器"><a href="#Spring-Boot：简化-Spring-开发的神器" class="headerlink" title="Spring Boot：简化 Spring 开发的神器"></a>Spring Boot：简化 Spring 开发的神器</h1><h2 id="Spring-Boot-简介"><a href="#Spring-Boot-简介" class="headerlink" title="Spring Boot 简介"></a>Spring Boot 简介</h2><h3 id="什么是-Spring-Boot？"><a href="#什么是-Spring-Boot？" class="headerlink" title="什么是 Spring Boot？"></a>什么是 Spring Boot？</h3><blockquote>
<p><code>Spring Boot</code> 是基于 <code>Spring Framework</code> 的一个开源 <code>Java</code> 基于 <code>Spring</code> 框架的快速开发框架，由 <code>Pivotal</code> 团队开发。它旨在简化 <code>Spring</code> 应用的初始搭建以及开发过程。<br><code>Spring Boot</code> 的核心目标是让开发者能够快速上手，减少配置，快速启动和运行一个基于 <code>Spring</code> 的应用。</p>
</blockquote>
<h3 id="Spring-Boot-的主要特点"><a href="#Spring-Boot-的主要特点" class="headerlink" title="Spring Boot 的主要特点"></a>Spring Boot 的主要特点</h3><ul>
<li><code>独立运行</code>：Spring Boot 应用内嵌了 Tomcat、Jetty 或 Undertow 作为 Web 容器，无需部署 WAR 文件，直接运行即可。</li>
<li><code>自动配置</code>：Spring Boot 根据添加的依赖自动配置 Spring 和相关项目，例如添加 spring-boot-starter-web 依赖后，Spring Boot 会自动配置 Tomcat 和 Spring MVC。</li>
<li><code>无需 XML 配置</code>：Spring Boot 提倡使用 Java 配置替代传统的 XML 配置，使得配置更加简洁、易懂。</li>
<li><code>微服务支持</code>：Spring Boot 与 Spring Cloud 深度集成，支持微服务架构的开发，方便构建分布式系统。</li>
<li><code>健康检查和监控</code>：Spring Boot 提供了丰富的监控和健康检查功能，通过 actuator 模块可以轻松监控应用的运行状态。</li>
</ul>
<h3 id="为什么选择-Spring-Boot？"><a href="#为什么选择-Spring-Boot？" class="headerlink" title="为什么选择 Spring Boot？"></a>为什么选择 Spring Boot？</h3><ul>
<li><code>简化开发</code>：Spring Boot 的自动配置功能减少了大量的配置工作，让开发者可以专注于业务逻辑。</li>
<li><code>快速启动</code>：内嵌的 Web 容器使得应用可以快速启动，无需复杂的部署过程。</li>
<li><code>强大的生态系统</code>：Spring Boot 与 Spring 生态系统无缝集成，支持多种技术栈，如 Spring Data、Spring Security、Spring Cloud 等。</li>
<li><code>易于部署</code>：Spring Boot 应用可以打包成一个独立的 JAR 文件，方便部署到任何支持 Java 的环境中。</li>
</ul>
<h3 id="尝试使用Spring-Boot"><a href="#尝试使用Spring-Boot" class="headerlink" title="尝试使用Spring Boot"></a>尝试使用Spring Boot</h3><h4 id="使用-Spring-Initializr"><a href="#使用-Spring-Initializr" class="headerlink" title="使用 Spring Initializr"></a>使用 <a target="_blank" rel="noopener" href="https://start.spring.io/">Spring Initializr</a></h4><blockquote>
<p><a target="_blank" rel="noopener" href="https://start.spring.io/">Spring Initializr</a> 是一个在线工具，可以帮助开发者快速生成 Spring Boot 项目的初始代码。以下是使用步骤：<br> 1.访问 <a target="_blank" rel="noopener" href="https://start.spring.io/">Spring Initializr</a> 网站。<br> 2.在左侧选择项目的基本信息，如项目类型（Maven 或 Gradle）、语言（Java、Kotlin 或 Groovy）、Spring Boot 版本等。<br> 3.在右侧选择需要的依赖，例如 Spring Web、Spring Data JPA、Spring Security 等。<br> 4.点击“Generate”按钮下载生成的项目压缩包。<br> 5.解压后，导入到你的开发工具（如 IntelliJ IDEA 或 Eclipse）中。</p>
</blockquote>
<h3 id="手动创建项目"><a href="#手动创建项目" class="headerlink" title="手动创建项目"></a>手动创建项目</h3><blockquote>
<p>如果你不想使用 <a target="_blank" rel="noopener" href="https://start.spring.io/">Spring Initializr</a>，也可以手动创建 Spring Boot 项目。以下是基于 Maven 的手动创建</p>
</blockquote>
<h4 id="推荐工具"><a href="#推荐工具" class="headerlink" title="推荐工具"></a>推荐工具</h4><ul>
<li><a target="_blank" rel="noopener" href="https://www.jetbrains.com/">IntelliJ</a> IDEA</li>
</ul>
<h4 id="项目目录结构"><a href="#项目目录结构" class="headerlink" title="项目目录结构"></a>项目目录结构</h4><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">my-spring-boot/</span><br><span class="line">├── src/</span><br><span class="line">│   ├── main/</span><br><span class="line">│   │   ├── java/</span><br><span class="line">│   │   └── resources/</span><br><span class="line">│   └── test/</span><br><span class="line">│       ├── java/</span><br><span class="line">│       └── resources/</span><br><span class="line">└── pom.xml</span><br></pre></td></tr></table></figure>
<h4 id="编写-pom-xml-文件，添加-Spring-Boot-的父依赖和相关依赖"><a href="#编写-pom-xml-文件，添加-Spring-Boot-的父依赖和相关依赖" class="headerlink" title="编写 pom.xml 文件，添加 Spring Boot 的父依赖和相关依赖"></a>编写 pom.xml 文件，添加 Spring Boot 的父依赖和相关依赖</h4><figure class="highlight xml"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">project</span> <span class="attr">xmlns</span>=<span class="string">&quot;http://maven.apache.org/POM/4.0.0&quot;</span> <span class="attr">xmlns:xsi</span>=<span class="string">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span></span><br><span class="line"><span class="tag">         <span class="attr">xsi:schemaLocation</span>=<span class="string">&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">modelVersion</span>&gt;</span>4.0.0<span class="tag">&lt;/<span class="name">modelVersion</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>com.example<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>my-spring-boot-project<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">version</span>&gt;</span>1.0.0<span class="tag">&lt;/<span class="name">version</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">parent</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-parent<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">version</span>&gt;</span>3.0.0<span class="tag">&lt;/<span class="name">version</span>&gt;</span> <span class="comment">&lt;!-- 替换为最新版本 --&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">parent</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">dependencies</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">            <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-web<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line">        <span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;/<span class="name">dependencies</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">project</span>&gt;</span></span><br></pre></td></tr></table></figure>
<h4 id="创建主类-MySpringBootApplication"><a href="#创建主类-MySpringBootApplication" class="headerlink" title="创建主类 MySpringBootApplication"></a>创建主类 <code>MySpringBootApplication</code></h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> org.springframework.boot.SpringApplication;</span><br><span class="line"><span class="keyword">import</span> org.springframework.boot.autoconfigure.SpringBootApplication;</span><br><span class="line"> </span><br><span class="line"><span class="meta">@SpringBootApplication</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">MySpringBootApplication</span> &#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">(String[] args)</span> &#123;</span><br><span class="line">        SpringApplication.run(MySpringBootApplication.class, args);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="编写一个简单的-RESTful-API"><a href="#编写一个简单的-RESTful-API" class="headerlink" title="编写一个简单的 RESTful API"></a>编写一个简单的 <code>RESTful API</code></h4><h5 id="Controller-接口"><a href="#Controller-接口" class="headerlink" title="Controller (接口)"></a>Controller (接口)</h5><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="keyword">import</span> org.springframework.web.bind.annotation.GetMapping;</span><br><span class="line"><span class="keyword">import</span> org.springframework.web.bind.annotation.RestController;</span><br><span class="line"> </span><br><span class="line"><span class="meta">@RestController</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">HelloController</span> &#123;</span><br><span class="line"> </span><br><span class="line">    <span class="meta">@GetMapping(&quot;/hello&quot;)</span></span><br><span class="line">    <span class="keyword">public</span> String <span class="title function_">hello</span><span class="params">()</span> &#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;Hello, Spring Boot!&quot;</span>;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h4 id="运行应用"><a href="#运行应用" class="headerlink" title="运行应用"></a>运行应用</h4><blockquote>
<p>运行主类 MySpringBootApplication，访问 <a target="_blank" rel="noopener" href="http://localhost:8080/hello%EF%BC%8C%E4%BD%A0%E5%BA%94%E8%AF%A5%E4%BC%9A%E7%9C%8B%E5%88%B0%E8%BF%94%E5%9B%9E%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%9A%E2%80%9CHello">http://localhost:8080/hello，你应该会看到返回的字符串：“Hello</a>, Spring Boot!”。</p>
</blockquote>
<h4 id="配置-Spring-Boot"><a href="#配置-Spring-Boot" class="headerlink" title="配置 Spring Boot"></a>配置 Spring Boot</h4><blockquote>
<p><code>Spring Boot</code> 使用 <code>application.properties</code> 或 <code>application.yml</code> 文件来配置应用</p>
</blockquote>
<h4 id="application-properties"><a href="#application-properties" class="headerlink" title="application.properties"></a>application.properties</h4><figure class="highlight properties"><table><tr><td class="code"><pre><span class="line"><span class="attr">server.port</span>=<span class="string">8081 #运行端口</span></span><br></pre></td></tr></table></figure>
<h4 id="application-yml"><a href="#application-yml" class="headerlink" title="application.yml"></a>application.yml</h4><figure class="highlight yml"><table><tr><td class="code"><pre><span class="line"><span class="attr">server:</span></span><br><span class="line">  <span class="attr">port:</span> <span class="number">8081</span> <span class="comment">#运行端口</span></span><br></pre></td></tr></table></figure>
<h4 id="项目打包"><a href="#项目打包" class="headerlink" title="项目打包"></a>项目打包</h4><h5 id="打包为-JAR-文件"><a href="#打包为-JAR-文件" class="headerlink" title="打包为 JAR 文件"></a>打包为 JAR 文件</h5><blockquote>
<p>使用 <code>Maven</code> 或 <code>Gradle</code> 打包项目：</p>
</blockquote>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># Maven</span><br><span class="line">mvn clean package</span><br><span class="line"> </span><br><span class="line"># Gradle</span><br><span class="line">./gradlew build</span><br></pre></td></tr></table></figure>
<blockquote>
<p>打包完成后，你会在 target 或 build 文件夹中找到生成的 JAR 文件</p>
</blockquote>
<h5 id="运行-JAR-文件"><a href="#运行-JAR-文件" class="headerlink" title="运行 JAR 文件"></a>运行 JAR 文件</h5><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">java -jar &lt;JAR Name&gt;.jar</span><br></pre></td></tr></table></figure>

<h3 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h3><blockquote>
<p><code>Spring Boot</code> 是一个强大的 <code>Spring</code> 开发框架，它简化了 <code>Spring</code> 应用的开发过程，提供了<code>自动配置</code>、<code>独立运行</code>、<code>微服务</code>支持等特性。<br>通过本文的介绍，你已经了解了 <code>Spring Boot</code> 的基本使用方法和高级特性。<br>希望这些知识能帮助你在实际开发中快速上手 <code>Spring Boot</code>，构建<code>高效</code>、<code>可靠</code>的 <code>Spring</code> 应用。</p>
</blockquote>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="https://blog.tuxiw.cn">月月</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="https://blog.tuxiw.cn/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringBoot.html">https://blog.tuxiw.cn/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringBoot.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来源 <a href="https://blog.tuxiw.cn" target="_blank">月月博客</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Spring/">Spring</a><a class="post-meta__tags" href="/tags/Java/">Java</a><a class="post-meta__tags" href="/tags/SpringBoot/">SpringBoot</a></div><div class="post-share"><div class="social-share" data-image="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合6" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><a class="pagination-related" href="/pages/%E6%8E%A8%E8%8D%90/Api%20%E6%8E%A5%E5%8F%A3%E6%8E%A8%E8%8D%90.html" title="Api 接口推荐"><img class="cover" src="/img/loading.gif" data-original="https://cos.tuxiw.cn/blog/bg2.webp" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="info"><div class="info-1"><div class="info-item-1">上一篇</div><div class="info-item-2">Api 接口推荐</div></div><div class="info-2"><div class="info-item-1">前言 本站有使用API图片接口，推荐的接口与本站无关！  Jitsuの涩图接口[随机涩图]地址：Jitsuの随机涩图  图片数量统计：全部（all）：20000+横屏壁纸（pc）：1000+竖屏壁纸（mp）：2000+银发（silver）：1500+兽耳（furry）：2000+星空（starry）：500+涩图（setu）：4000+1080P（1080）：3000+P站随机图（pixiv）：50000+18+（r18）：10000+我的收藏（jitsu）：6000+  调用示例 直接调用 https://moe.jitsu.top/img 类别数量 https://moe.jitsu.top/img/?sort=pixiv&amp;num=3 设置规格 https://moe.jitsu.top/img/?sort=pc&amp;size=mw1024 返回json https://moe.jitsu.top/img/?sort=r18&amp;size=1080p&amp;type=json 设置反代...</div></div></div></a><a class="pagination-related" href="/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringCloud.html" title="Spring Cloud 简介"><img class="cover" src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合12" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="info text-right"><div class="info-1"><div class="info-item-1">下一篇</div><div class="info-item-2">Spring Cloud 简介</div></div><div class="info-2"><div class="info-item-1">Spring Cloud 详解什么是Spring Cloud Spring Cloud是构建分布式系统的工具集，它基于Spring Boot，提供了一系列解决分布式系统常见问题的框架。Spring Cloud专注于为典型的分布式系统用例提供良好的开箱即用体验，如配置管理、服务发现、熔断器、智能路由、微代理、控制总线等。   Spring Cloud是一个全家桶式的技术栈，用于构建分布式微服务架构的一站式解决方案。它利用了Spring Boot的开发便利性，集成了多种微服务架构的落地技术，如服务注册与发现、配置中心、服务网关、智能路由、负载均衡、断路器、监控跟踪和分布式消息队列等等。通过Spring Cloud，开发人员可以简化分布式系统基础设施的开发，并快速启动服务或构建应用，同时能够快速与云平台资源进行对接。  Spring Cloud的核心优势 开箱即用：提供了一系列默认配置，让开发者能够快速上手 组件丰富：提供了微服务架构中所需的各种组件和工具 基于Spring Boot：与Spring...</div></div></div></a></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><a class="pagination-related" href="/pages/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/SpringCloud.html" title="Spring Cloud 简介"><img class="cover" src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合12" alt="cover"><div class="info text-center"><div class="info-1"><div class="info-item-1"><i class="far fa-calendar-alt fa-fw"></i> 2025-05-08</div><div class="info-item-2">Spring Cloud 简介</div></div><div class="info-2"><div class="info-item-1">Spring Cloud 详解什么是Spring Cloud Spring Cloud是构建分布式系统的工具集，它基于Spring Boot，提供了一系列解决分布式系统常见问题的框架。Spring Cloud专注于为典型的分布式系统用例提供良好的开箱即用体验，如配置管理、服务发现、熔断器、智能路由、微代理、控制总线等。   Spring Cloud是一个全家桶式的技术栈，用于构建分布式微服务架构的一站式解决方案。它利用了Spring Boot的开发便利性，集成了多种微服务架构的落地技术，如服务注册与发现、配置中心、服务网关、智能路由、负载均衡、断路器、监控跟踪和分布式消息队列等等。通过Spring Cloud，开发人员可以简化分布式系统基础设施的开发，并快速启动服务或构建应用，同时能够快速与云平台资源进行对接。  Spring Cloud的核心优势 开箱即用：提供了一系列默认配置，让开发者能够快速上手 组件丰富：提供了微服务架构中所需的各种组件和工具 基于Spring Boot：与Spring...</div></div></div></a></div></div><hr class="custom-hr"/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info text-center"><div class="avatar-img"><img src="/img/loading.gif" data-original="/img/tx/tx1.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info-name">月月</div><div class="author-info-description">欢迎来到月月的技术资源站</div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">10</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">20</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">7</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/fs529"><i class="fab fa-github"></i><span>前往 Gitee</span></a><div class="card-info-social-icons"><a class="social-icon" href="https://github.com/shenyu2806" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="/tuzwsy@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">欢迎来到月月的博客! <br> 主地址：<a href="https://blog.tuxiw.cn" style="color:#49b1f5">blog.tuxiw.cn</a><br> 备用地址：<a target="_blank" rel="noopener" href="https://blog-shenyun.pages.dev" style="color:#49b1f5">blog-shenyun.pages.dev</a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Spring-Boot%EF%BC%9A%E7%AE%80%E5%8C%96-Spring-%E5%BC%80%E5%8F%91%E7%9A%84%E7%A5%9E%E5%99%A8"><span class="toc-number">1.</span> <span class="toc-text">Spring Boot：简化 Spring 开发的神器</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#Spring-Boot-%E7%AE%80%E4%BB%8B"><span class="toc-number">1.1.</span> <span class="toc-text">Spring Boot 简介</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%80%E4%B9%88%E6%98%AF-Spring-Boot%EF%BC%9F"><span class="toc-number">1.1.1.</span> <span class="toc-text">什么是 Spring Boot？</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Spring-Boot-%E7%9A%84%E4%B8%BB%E8%A6%81%E7%89%B9%E7%82%B9"><span class="toc-number">1.1.2.</span> <span class="toc-text">Spring Boot 的主要特点</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B8%BA%E4%BB%80%E4%B9%88%E9%80%89%E6%8B%A9-Spring-Boot%EF%BC%9F"><span class="toc-number">1.1.3.</span> <span class="toc-text">为什么选择 Spring Boot？</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%B0%9D%E8%AF%95%E4%BD%BF%E7%94%A8Spring-Boot"><span class="toc-number">1.1.4.</span> <span class="toc-text">尝试使用Spring Boot</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E4%BD%BF%E7%94%A8-Spring-Initializr"><span class="toc-number">1.1.4.1.</span> <span class="toc-text">使用 Spring Initializr</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%89%8B%E5%8A%A8%E5%88%9B%E5%BB%BA%E9%A1%B9%E7%9B%AE"><span class="toc-number">1.1.5.</span> <span class="toc-text">手动创建项目</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%8E%A8%E8%8D%90%E5%B7%A5%E5%85%B7"><span class="toc-number">1.1.5.1.</span> <span class="toc-text">推荐工具</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A1%B9%E7%9B%AE%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84"><span class="toc-number">1.1.5.2.</span> <span class="toc-text">项目目录结构</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BC%96%E5%86%99-pom-xml-%E6%96%87%E4%BB%B6%EF%BC%8C%E6%B7%BB%E5%8A%A0-Spring-Boot-%E7%9A%84%E7%88%B6%E4%BE%9D%E8%B5%96%E5%92%8C%E7%9B%B8%E5%85%B3%E4%BE%9D%E8%B5%96"><span class="toc-number">1.1.5.3.</span> <span class="toc-text">编写 pom.xml 文件，添加 Spring Boot 的父依赖和相关依赖</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA%E4%B8%BB%E7%B1%BB-MySpringBootApplication"><span class="toc-number">1.1.5.4.</span> <span class="toc-text">创建主类 MySpringBootApplication</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E7%BC%96%E5%86%99%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84-RESTful-API"><span class="toc-number">1.1.5.5.</span> <span class="toc-text">编写一个简单的 RESTful API</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#Controller-%E6%8E%A5%E5%8F%A3"><span class="toc-number">1.1.5.5.1.</span> <span class="toc-text">Controller (接口)</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C%E5%BA%94%E7%94%A8"><span class="toc-number">1.1.5.6.</span> <span class="toc-text">运行应用</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%85%8D%E7%BD%AE-Spring-Boot"><span class="toc-number">1.1.5.7.</span> <span class="toc-text">配置 Spring Boot</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#application-properties"><span class="toc-number">1.1.5.8.</span> <span class="toc-text">application.properties</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#application-yml"><span class="toc-number">1.1.5.9.</span> <span class="toc-text">application.yml</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A1%B9%E7%9B%AE%E6%89%93%E5%8C%85"><span class="toc-number">1.1.5.10.</span> <span class="toc-text">项目打包</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%93%E5%8C%85%E4%B8%BA-JAR-%E6%96%87%E4%BB%B6"><span class="toc-number">1.1.5.10.1.</span> <span class="toc-text">打包为 JAR 文件</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%BF%90%E8%A1%8C-JAR-%E6%96%87%E4%BB%B6"><span class="toc-number">1.1.5.10.2.</span> <span class="toc-text">运行 JAR 文件</span></a></li></ol></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-number">1.1.6.</span> <span class="toc-text">总结</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/pages/%E7%BD%91%E7%AB%99/Website%20revenue.html" title="网站被收录情况"><img src="/img/loading.gif" data-original="https://cos.tuxiw.cn/blog/bg4.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="网站被收录情况"/></a><div class="content"><a class="title" href="/pages/%E7%BD%91%E7%AB%99/Website%20revenue.html" title="网站被收录情况">网站被收录情况</a><time datetime="2025-06-12T13:30:46.000Z" title="发表于 2025-06-12 21:30:46">2025-06-12</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/pages/SSL/FreeSSL.html" title="FreeSSL申请免费证书"><img src="/img/loading.gif" data-original="https://cos.tuxiw.cn/blog/bg3.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="FreeSSL申请免费证书"/></a><div class="content"><a class="title" href="/pages/SSL/FreeSSL.html" title="FreeSSL申请免费证书">FreeSSL申请免费证书</a><time datetime="2025-05-10T03:00:51.000Z" title="发表于 2025-05-10 11:00:51">2025-05-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/pages/SSL/allinssl.html" title="allinssl提供免费SSL泛域名通配符SSL证书"><img src="/img/loading.gif" data-original="https://cos.tuxiw.cn/blog/bg1.webp" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="allinssl提供免费SSL泛域名通配符SSL证书"/></a><div class="content"><a class="title" href="/pages/SSL/allinssl.html" title="allinssl提供免费SSL泛域名通配符SSL证书">allinssl提供免费SSL泛域名通配符SSL证书</a><time datetime="2025-05-10T02:33:33.000Z" title="发表于 2025-05-10 10:33:33">2025-05-10</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/pages/%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9/Hexo2.html" title="Hexo博客每天自动生成每日早报文章"><img src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合9" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo博客每天自动生成每日早报文章"/></a><div class="content"><a class="title" href="/pages/%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9/Hexo2.html" title="Hexo博客每天自动生成每日早报文章">Hexo博客每天自动生成每日早报文章</a><time datetime="2025-05-08T02:41:44.000Z" title="发表于 2025-05-08 10:41:44">2025-05-08</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/pages/%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9/Hexo.html" title="Hexo博客实现随机文章功能"><img src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合11" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="Hexo博客实现随机文章功能"/></a><div class="content"><a class="title" href="/pages/%E4%B8%BB%E9%A2%98%E9%AD%94%E6%94%B9/Hexo.html" title="Hexo博客实现随机文章功能">Hexo博客实现随机文章功能</a><time datetime="2025-05-08T02:19:24.000Z" title="发表于 2025-05-08 10:19:24">2025-05-08</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer_button"><ul class="buttons"><li class="icon Email"><span class="bubble">Email</span><a href="mailto:tuzwsy@gmail.com"><i class="fa-solid fa-envelope"></i></a></li><li class="icon QQ"><span class="bubble">QQ</span><a href="tencent://Message/?Uin=758427981&amp;websiteName=q-zone.qq.com&amp;Menu=yes"><i class="fa-brands fa-qq"></i></a></li><li class="icon top"><span class="bubble">top</span><a href="#"><i class="fa-solid fa-angle-up"></i></a></li><li class="icon github"><span class="bubble">Github</span><a target="_blank" rel="noopener" href="https://github.com/shenyu2806"><i class="fab fa-github"></i></a></li><li class="icon CSDN"><span class="bubble">Gitee</span><a target="_blank" rel="noopener" href="https://gitee.com/fs529"><i class="fab fa-github"></i></a></li></ul></div><div id="Hsu-foot"><div class="footer-group"><h3 class="footer-title">直达</h3><div class="footer-links"><a class="footer-item" href="/" target="_blank">我的主页</a><a class="footer-item" href="/bb">个人动态</a><a class="footer-item" href="/random">随机文章</a></div></div><div class="footer-group"><h3 class="footer-title">分类</h3><div class="footer-links"><a class="footer-item" href="/categories/学习笔记/">学习笔记</a></div></div><div class="footer-group"><h3 class="footer-title">关于</h3><div class="footer-links"><a class="footer-item" href="/about">关于我</a><a class="footer-item" href="/archives">文章归档</a></div></div><div class="footer-group"><h3 class="footer-title">友链</h3><div class="footer-links"><a class="footer-item" href="/flink">在这里 ✨</a><a class="footer-item" href="mailto:tuzwsy@gmail.com">广告位招租啦</a></div></div><div class="footer-group"><h3 class="footer-title">协议</h3><div class="footer-links"><a class="footer-item" href="/privacy">隐私协议</a><a class="footer-item" href="/cc">版权协议</a></div></div></div><div id="footer-wrap"><div class="copyright">&copy;2019 - 2025  <i id="heartbeat" class="fa fas fa-heartbeat"></i> 月月</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a><span class="footer-separator">|</span><span> <a target="_blank" rel="noopener" href="https://icp.gov.moe/?keyword=20248911">萌ICP备20248911号</a></span></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="share" type="button" title="分享链接" onclick="share()"><i class="fas fa-share-nodes"></i></button><a id="to_comment" href="#post-comment" title="前往评论"><i class="fas fa-comments"></i></a><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button><button id="go-down" type="button" title="直达底部" onclick="btf.scrollToDest(document.body.scrollHeight, 500)"><i class="fas fa-arrow-down"></i></button></div></div><div id="rightMenu"><div class="rightMenu-group rightMenu-small"><div class="rightMenu-item" id="menu-backward"><i class="fa-solid fa-arrow-left"></i></div><div class="rightMenu-item" id="menu-forward"><i class="fa-solid fa-arrow-right"></i></div><div class="rightMenu-item" id="menu-refresh"><i class="fa-solid fa-arrow-rotate-right"></i></div><div class="rightMenu-item" id="menu-home"><i class="fa-solid fa-house"></i></div></div><div class="rightMenu-group rightMenu-line"><a class="rightMenu-item" id="menu-radompage" href="/random"><i class="fa-solid fa-shoe-prints"></i><span>随便逛逛</span></a><div class="rightMenu-item" id="menu-share"><i class="fas fa-share-nodes"></i><span>分享链接</span></div></div></div><div id="rightmenu-mask" onclick="RemoveRightMenu()"></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"><script>(() => {
  const isShuoshuo = GLOBAL_CONFIG_SITE.pageType === 'shuoshuo'
  const option = null

  const getCount = () => {
    const countELement = document.getElementById('twikoo-count')
    if(!countELement) return
    twikoo.getCommentsCount({
      envId: 'https://twikoo.tuxiw.cn/',
      region: '',
      urls: [window.location.pathname],
      includeReply: false
    }).then(res => {
      countELement.textContent = res[0].count
    }).catch(err => {
      console.error(err)
    })
  }

  const init = (el = document, path = location.pathname) => {
    twikoo.init({
      el: el.querySelector('#twikoo-wrap'),
      envId: 'https://twikoo.tuxiw.cn/',
      region: '',
      onCommentLoaded: () => {
        btf.loadLightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
      },
      ...option,
      path: isShuoshuo ? path : (option && option.path) || path
    })

    

    isShuoshuo && (window.shuoshuoComment.destroyTwikoo = () => {
      if (el.children.length) {
        el.innerHTML = ''
        el.classList.add('no-comment')
      }
    })
  }

  const loadTwikoo = (el, path) => {
    if (typeof twikoo === 'object') setTimeout(() => init(el, path), 0)
    else btf.getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(() => init(el, path))
  }

  if (isShuoshuo) {
    'Twikoo' === 'Twikoo'
      ? window.shuoshuoComment = { loadComment: loadTwikoo }
      : window.loadOtherComment = loadTwikoo
    return
  }

  if ('Twikoo' === 'Twikoo' || !false) {
    if (false) btf.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
    else loadTwikoo()
  } else {
    window.loadOtherComment = loadTwikoo
  }
})()</script></div><script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.11/clipboard.min.js"></script><script src="/js/floatbox.js"></script><script src="//geoip-js.com/js/apis/geoip2/v2.1/geoip2.js" type="text/javascript"></script><canvas id="universe"></canvas><script defer src="/js/universe.js"></script><script async src="https://npm.elemecdn.com/tzy-blog/lib/js/other/sakura.js"></script><script async src="/js/custom.js"></script><script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script><script async src="/js/rightmenu.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_swiper_injector_config(){
    var parent_div_git = document.getElementById('recent-posts');
    var item_html = '<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="pages/主题配置/Hexo 从零开始搭建个人博客 (配置404).html" alt=""><img width="48" height="48" src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合6" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-24</span><a class="blog-slider__title" href="pages/主题配置/Hexo 从零开始搭建个人博客 (配置404).html" alt="">Hexo 从零开始搭建个人博客 (配置404)</a><div class="blog-slider__text">再怎么看我也不知道怎么描述它的啦！</div><a class="blog-slider__button" href="pages/主题配置/Hexo 从零开始搭建个人博客 (配置404).html" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="pages/主题魔改/Hexo.html" alt=""><img width="48" height="48" src="/img/loading.gif" data-original="https://api.r10086.com/樱道随机图片api接口.php?图片系列=动漫综合11" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-08</span><a class="blog-slider__title" href="pages/主题魔改/Hexo.html" alt="">Hexo博客实现随机文章功能</a><div class="blog-slider__text">再怎么看我也不知道怎么描述它的啦！</div><a class="blog-slider__button" href="pages/主题魔改/Hexo.html" alt="">详情   </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" href="pages/推荐/Api 接口推荐.html" alt=""><img width="48" height="48" src="/img/loading.gif" data-original="https://cos.tuxiw.cn/blog/bg2.webp" alt="" onerror="this.src=https://unpkg.zhimg.com/akilar-candyassets/image/loading.gif; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-06</span><a class="blog-slider__title" href="pages/推荐/Api 接口推荐.html" alt="">Api 接口推荐</a><div class="blog-slider__text">再怎么看我也不知道怎么描述它的啦！</div><a class="blog-slider__button" href="pages/推荐/Api 接口推荐.html" alt="">详情   </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>';
    console.log('已挂载butterfly_swiper')
    parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  var elist = 'undefined'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_swiper_injector_config();
  }
  else if (epage === cpage){
    butterfly_swiper_injector_config();
  }
  </script><script defer src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper.min.js"></script><script defer data-pjax src="https://npm.elemecdn.com/hexo-butterfly-swiper/lib/swiper_init.js"></script><!-- hexo injector body_end end -->
        <style>
            [bg-lazy] {
                background-image: none !important;
                background-color: #eee !important;
            }
        </style>
        <script>
            window.imageLazyLoadSetting = {
                isSPA: false,
                preloadRatio: 1,
                processImages: null,
            };
        </script><script>window.addEventListener("load",function(){var t=/\.(gif|jpg|jpeg|tiff|png)$/i,r=/^data:image\/[a-z\d\-\.\+]+;base64,/;Array.prototype.slice.call(document.querySelectorAll("img[data-original]")).forEach(function(a){var e=a.parentNode;"A"===e.tagName&&(t.test(e.href)||r.test(e.href))&&(e.href=a.dataset.original)})});</script><script>(r=>{r.imageLazyLoadSetting.processImages=t;var a=r.imageLazyLoadSetting.isSPA,o=r.imageLazyLoadSetting.preloadRatio||1,d=i();function i(){var t=Array.prototype.slice.call(document.querySelectorAll("img[data-original]")),e=Array.prototype.slice.call(document.querySelectorAll("[bg-lazy]"));return t.concat(e)}function t(t){(a||t)&&(d=i());for(var e,n=0;n<d.length;n++)0<=(e=(e=d[n]).getBoundingClientRect()).bottom&&0<=e.left&&e.top<=(r.innerHeight*o||document.documentElement.clientHeight*o)&&(()=>{var t,e,a,o,i=d[n];e=function(){d=d.filter(function(t){return i!==t}),r.imageLazyLoadSetting.onImageLoaded&&r.imageLazyLoadSetting.onImageLoaded(i)},(t=i).dataset.loaded||(t.hasAttribute("bg-lazy")?(t.removeAttribute("bg-lazy"),e&&e()):(a=new Image,o=t.getAttribute("data-original"),a.onload=function(){t.src=o,t.removeAttribute("data-original"),t.setAttribute("data-loaded",!0),e&&e()},a.onerror=function(){t.removeAttribute("data-original"),t.setAttribute("data-loaded",!1),t.src=o},t.src!==o&&(a.src=o)))})()}function e(){clearTimeout(t.tId),t.tId=setTimeout(t,500)}t(),document.addEventListener("scroll",e),r.addEventListener("resize",e),r.addEventListener("orientationchange",e)})(this);</script></body></html>